# ... existing code ...

class DebateController:
    def __init__(self, topic, debate_mode="ai_vs_ai", human_side="正方"):
        self.debate_mode = debate_mode  # 新增辩论模式参数
        self.human_side = human_side    # 记录人类辩方
        # 其余初始化保持不变...

    def run_debate(self):
        """运行辩论赛流程（支持人机模式）"""
        # 开始阶段
        yield self.host.name, self.host.start_debate(topic=self.topic)

        # 辩论阶段
        stages = self.debate_flow.get_flow_stages()
        for stage in stages:
            stage_name = stage.get('name')
            yield self.host.name, self.host.control_stage(stage_name)
            actions = stage.get('actions', [])
            for action in actions:
                side = action.get('side')
                position = action.get('position')
                action_type = action.get('action_type')

                # 寻找对应辩手时增加模式判断
                for debater in self.debaters:
                    if debater.side == side and debater.position == position:
                        if self.debate_mode == "human_vs_ai" and side == self.human_side:
                            # 人类辩手环节，返回特殊标识等待输入
                            yield "human_turn", (debater.side+debater.name, stage_name)
                        else:
                            # AI辩手正常发言
                            yield debater.side+debater.name, debater.debate(stage_name, action_type)
                        break

        # 后续阶段保持不变...

    def human_response(self, message):
        """接收人类辩手的发言"""
        # 这里可以添加发言逻辑验证
        return message
